package spt.services;

import java.util.logging.Logger;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

import spt.exceptions.SlideException;
import spt.slides.SlideManager;
import spt.slides.SlideXMLWriter;
import spt.utils.ExceptionXMLWriter;

@Path("/client")
public class ClientResources {
	private final Logger log = Logger.getLogger(ClientResources.class.getName());
	
	@GET
	public String getCurrentSlides(){
		SlideManager slideManager = new SlideManager();
		try {
			return SlideXMLWriter.writeList(slideManager.getCurrentSlides());
		} catch (SlideException e) {
			log.severe(e.getMessage());
			return ExceptionXMLWriter.write(e);
		}
	}
}
